<template>
	<view class="priceBox">
		<view class="priceItem" v-for="(item,index) in list" :key="index">
			<view class="priceTitle" v-if="item.title != ''"> {{item.title}}</view>
			<view class="priceItemBox"  style="margin-bottom: 5px;" v-for="(small,i) in item.itemList" @click="handelClick(small.type)">
				<view class="left">
					<view class="headImage">
						<image style="width: 35px;height: 35px;"  :src="small.head"></image>
					</view>
					<view class="headItem">
						<view class="headTitle">{{small.name}}</view>
						<view class="price">
							<view class="priceImage" v-if="small.leftIcon !=''">
								<image :src="small.leftIcon" mode=""></image>
							</view>
							<view class="priceMoune">{{small.price}}</view>
						</view>
					</view>
				</view>
				<view class="right">
					<image :src="small.rightIcon !=''?'/static/img/chevron-right.png':'/static/img/info-circle.png'" mode=""></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			list:{
				type:Array,
				default:()=>[]
			}
		},
		methods:{
			handelClick(i){
				this.$emit("handelClick",i)
			}
		}
	}
</script>

<style lang="scss">
	.priceBox{
		width: 100%;
		overflow: auto;
		font-family: STKaiti;
		.priceItem{
			width: calc(100% - 60rpx);
			overflow: auto;
			margin: 0 auto;
			.priceTitle{
				color: #fff;
				padding: 10rpx 0;
			}
			.priceItemBox{
				height: 90rpx;
				display: flex;
				justify-content: space-between;
				padding: 20rpx;
				background-color: rgba(255, 255, 255, 0.3);
				border-radius: 10rpx;
				.left{
					width: 90%;
					display: flex;
					align-items: center;
					.headImage{
						height: 35px;
						width: 35px;
						background: #D3EFFC;
						border-radius: 50%;
						margin-right: 20rpx;
						
					}
					.headTitle{
						font-size: 28rpx;
						color: #fff;
					}
					.price{
						margin-top: 10rpx;
						height: 40rpx;
						display: flex;
						.priceImage{

							image{
								width: 28rpx;
								height: 28rpx;
								background: #D3EFFC;
								border-radius: 50%;
								border: none;
							}
						}
						.priceMoune{
							height: 40rpx;
							line-height: 40rpx;
							font-size: 22rpx;
							color: #fff;
						}
					}
					
				}
				.right{
					width: 10%;
					display: flex;
					flex-direction: row-reverse;
					image{
						width: 30rpx;
						height: 30rpx;
						margin: 30rpx 0;
					}
				}
			}
		}
	}
</style>